import request from '@/utils/request'

// 查询试验设备\计量设备信息列表
export function listEquipment(query) {
  return request({
    url: '/experiment/equipment/list',
    method: 'get',
    params: query
  })
}

// 查询试验设备\计量设备信息详细
export function getEquipment(equipmentId) {
  return request({
    url: '/experiment/equipment/' + equipmentId,
    method: 'get'
  })
}

// 新增试验设备\计量设备信息
export function addEquipment(data) {
  return request({
    url: '/experiment/equipment',
    method: 'post',
    data: data
  })
}

// 修改试验设备\计量设备信息
export function updateEquipment(data) {
  return request({
    url: '/experiment/equipment',
    method: 'put',
    data: data
  })
}

// 删除试验设备\计量设备信息
export function delEquipment(equipmentId) {
  return request({
    url: '/experiment/equipment/' + equipmentId,
    method: 'delete'
  })
}

// 导出试验设备\计量设备信息
export function exportEquipment(query) {
  return request({
    url: '/experiment/equipment/export',
    method: 'get',
    params: query
  })
}

// 下载导入模板
export function importTemplate() {
  return request({
    url: '/experiment/equipment/importTemplate',
    method: 'get'
  })
}

// 修改状态信息
export function changeState(equipmentId,state) {
  var data = {
    "ids" : equipmentId,
    "state" : state
  }
  return request({
    url: '/experiment/equipment/changeState',
    method: 'post',
    data: data
  })
}

// 新增维修信息
export function addRepair(data) {
  return request({
    url: '/experiment/repair',
    method: 'post',
    data: data
  })
}

// 查询维修信息列表
export function listRepair(query) {
  return request({
    url: '/experiment/repair/repairList',
    method: 'get',
    params: query
  })
}
